import actionTypes from '../action'


export default {
  [actionTypes.EXHIBITION_MANAGE]: {
    title: '展会',
    form: [{
        type: 'select',
        label: '省份',
        prop: 'provinceCode',
        cascader: 'cityCode',
        placeholder: '请选择省份',
        option(_, $store) {
          return $store.getters['dic/province']
        },
        auto_dispatch: 'dic/getCityDic',
        rule: {
          required: true,
          message: '省份不能为空',
          trigger: 'blur'
        }
      },
      {
        type: 'select',
        label: '城市',
        prop: 'cityCode',
        placeholder: '请选择城市',
        option(_, $store) {
          return $store.getters['dic/city']
        },
        dispatch: 'dic/getCity',
        rule: {
          required: true,
          message: '城市不能为空',
          trigger: 'blur'
        }
      },
      {
        type: 'text',
        prop: 'exhibitionName',
        label: '展会名称',
        placeholder: '请输入展会名称',
        rule: [{
          required: true,
          message: '请输入展会名称',
          trigger: 'blur'
        }, {
          max: 20,
          message: '展会名称不能超过20个字',
          trigger: 'blur'
        }]
      },
      {
        type: 'datetime',
        label: '开始时间',
        prop: 'startTime',
        rule: {
          required: true,
          message: '请选择开始时间',
          trigger: 'change'
        }
      },
      {
        type: 'datetime',
        label: '结束时间',
        prop: 'endTime',
        greater: 'startTime',
        rule: {
          required: true,
          message: '请选择结束时间',
          trigger: 'change'
        }
      },
    ]
  }
}